package com.jbit.examSystem.service.impl;

import com.jbit.examSystem.dao.CourseDao;
import com.jbit.examSystem.pojo.Chapter;
import com.jbit.examSystem.pojo.Course;
import com.jbit.examSystem.pojo.CourseCondition;
import com.jbit.examSystem.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseServiceImpl implements CourseService {
    @Autowired
    private CourseDao courseDao;

    @Override
    public List<Course> getAllCourse() {
        List<Course> courses = courseDao.getAllCourse();
        return courses;
    }

    @Override
    public List<Chapter> getCourseByName(Integer courseId) {
        List<Chapter> chapters = courseDao.getCourseByName(courseId);
        return chapters;
    }

    @Override
    public List<Course> getCourseByGradeId(Integer gradeId) {
        List<Course> courses = courseDao.getCourseByGradeId(gradeId);
        return courses;
    }
}
